from fdfs_client.client import Fdfs_client

if __name__ == '__main__':
    client = Fdfs_client('client.conf')
    ret = client.upload_by_filename('/home/python/Desktop/1.jpg')
    print(ret)
    '''
    {
        'Remote file_id': 'group1/M00/00/00/wKgvgFzOV1eAc03GAAAhg8MeEWU875.jpg',
        'Group name': 'group1',
        'Local file name': '/home/python/Desktop/1.jpg',
        'Storage IP': '192.168.47.128',
        'Status': 'Upload successed.',
        'Uploaded size': '8.00KB'
    }
    '''
# getting connection
# <fdfs_client.connection.Connection object at 0x7fe6885e47b8>
# <fdfs_client.fdfs_protol.Tracker_header object at 0x7fe6885e4780>
# {'Local file name': '/home/python/Desktop/1.jpg', 'Storage IP': '192.168.166.98', 'Group name': 'group1', 'Uploaded size': '80.00KB', 'Status': 'Upload successed.', 'Remote file_id': 'group1/M00/00/00/wKimYlzOuFiATL2iAAFCuQOFZcc329.jpg'}
#
# Process finished with exit code 0

# 这个创建的文件作为图片的测试使用